package com.zim.aliot.thread;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.aliyun.mns.model.Message;
import com.zim.aliot.service.ReceiverService;

@Component
public class AliMNSThreadDouble extends Thread{
    @Autowired
    private ReceiverService receiverService;
    
    public AliMNSThreadDouble() {
        super.setName("AliMNSThreadDouble");
    }
    
    @Override
    public void run() {
        
        while (!this.isInterrupted()) {
            Message message = receiverService.receiveMessage();
            System.out.println(message.getMessageBodyAsString());
        }

        System.out.println("循环完了");
    }
}
